<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('上传签收单')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-order-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">文件：</label>
                <div id="element" >
                    <div class="col-sm-8">
                        <input th:value="${scmOrder.scmOrderId}" name="id"  type="hidden">
                        <input type="file" id="receipt_file" name="receipt_file" required>
                        <a th:href="${scmOrder.receiptFile}" th:if="${not #strings.isEmpty(scmOrder.receiptFile)}" target="_blank">下载</a>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: jquery-cxselect-js" />

    <script th:inline="javascript">

        var prefix = ctx + "scm/order"
        $("#form-order-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var formData = new FormData($('#form-order-add')[0]);
                $.ajax({
                    url: prefix+"/uploadCredentials",
                    data: formData,
                    cache: false,
                    contentType: false,
                    processData: false,
                    type: 'POST',
                    beforeSend: function () {
                        $.modal.loading("正在处理中，请稍候...");
                        $.modal.disable();
                    },
                    success: function(result) {
                        if (typeof callback == "function") {
                            callback(result);
                        }
                        $.operate.successCallback(result);
                    },
                    complete: function () {

                    }
                });
               // $.operate.save(prefix + "/submitZhipai", $('#form-order-add').serialize());
            }
        }

    </script>
</body>
</html>
